import request from '@/utils/request'

const api_name = '/admin/product/categoryBrand'

//分页查询
export const GetCategoryBrandPageList = (page, limit, searchObj) => {
  return request({
    url: `${api_name}/${page}/${limit}`,
    method: 'get',
    params: searchObj,
  })
}

//品牌添加
export const SaveCategoryBrand = data => {
  return request({
    url: `${api_name}/save`,
    method: 'post',
    data: data,
  })
}

////品牌修改
export const UpdateCategoryBrand = data => {
  return request({
    url: `${api_name}/update`,
    method: 'put',
    data: data,
  })
}

////品牌删除
export const DeleteCategoryBrand = id => {
  return request({
    url: `${api_name}/delete/${id}`,
    method: 'delete',
  })
}

// 根据分类的id获取品牌数据
export const FindBrandByCategoryId = categoryId => {
  return request({
    url: `${api_name}/findBrandByCategoryId/${categoryId}`,
    method: 'get',
  })
}
